<%= form_for @admin, html: {class: 'form-horizontal'} do |f|%>

  <div class="form-group"><label class="col-sm-2 control-label">用户名</label>
    <div class="col-sm-3"> <%=f.text_field :name, class: 'form-control'%> </div>
  </div>

  <div class="form-group"><label class="col-sm-2 control-label">密码</label>
    <div class="col-sm-3"> <%=f.password_field :password_digest, class: 'form-control' %> </div>
  </div>

  <div class="form-group"><label class="col-sm-2 control-label">备注</label>
    <div class="col-sm-5"> <%=f.text_area :memo, class: 'form-control'%> </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">是否是超级管理员</label>
    <div class="col-sm-4">
      <%= f.check_box :root, class: 'form-control'%>
    </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">酒店管理</label>
    <div class="col-sm-4">
      <%= f.check_box :restaurant_permission, class: 'form-control'%>
    </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">会议管理</label>
    <div class="col-sm-4">
      <%= f.check_box :session_manage_permission, class: 'form-control'%>
    </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">会议通知</label>
    <div class="col-sm-4">
      <%= f.check_box :session_notifacation_permission, class: 'form-control'%>
    </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">嘉宾管理</label>
    <div class="col-sm-4">
      <%= f.check_box :attendee_manage_permission, class: 'form-control'%>
    </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">签到管理</label>
    <div class="col-sm-4">
      <%= f.check_box :checkin_manage_permission, class: 'form-control'%>
    </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">现场互动管理</label>
    <div class="col-sm-4">
      <%= f.check_box :interaction_manage_permission, class: 'form-control'%>
    </div>
  </div>

  <div class="form-inline"><label class="col-sm-2 control-label">销售员管理</label>
    <div class="col-sm-4">
      <%= f.check_box :seller_manage_permission, class: 'form-control'%>
    </div>
  </div>

  <div class="form-group">
    <div class="col-sm-4 col-sm-offset-2">
      <%=link_to '取消', admins_path, class: 'btn btn-white'%>
      <%= button_tag '保存', class: 'btn btn-primary'%>
    </div>
  </div>

  <% if @admin.persisted?%>
    <div class="hr-line-dashed"></div>

    <div class="form-group">
      <div class="col-sm-2 col-sm-offset-2">
        <%= link_to '删除管理员', admin_path(@admin), method: :delete, data: {confirm: "是否确认删除管理员 #{@admin.name}？"}, class: 'btn btn-danger btn-block btn-outline' %>
      </div>
    </div>
  <% end %>

<% end %>
